package cn.yuhe.basic.utils;


import lombok.Data;

@Data
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功";

    private Object resultObj;


    /**
    * @Title: 通过方法创建一个AjaxResult对象
    * @Description:
    * @Author: Mr.Qiu
    * @Version: 1.0
    * @Date:  2022/6/24 11:57
    * @Parameters: []
    * @Return cn.yuhe.basic.utils.AjaxResult
    */
    public static AjaxResult me(){

        return new AjaxResult();
    }

    /** 
    * @Title: 横向扩展
    * @Description:
    * @Author: Mr.Qiu
    * @Version: 1.0
    * @Date:  2022/6/24 12:39  
    * @Parameters: [success]
    * @Return cn.yuhe.basic.utils.AjaxResult
    */
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    /**
    * @Title: 横向扩展
    * @Description:
    * @Author: Mr.Qiu
    * @Version: 1.0
    * @Date:  2022/6/24 12:40
    * @Parameters: [message]
    * @Return cn.yuhe.basic.utils.AjaxResult
    */
    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
